package com.aaa.day1104.demo03;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Stream;

/**
 * @author ${崔灿}
 * @date 2022/11/04 17:36
 **/

public class Test02 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        Collections.addAll(list, "张无忌", "周芷若", "赵敏", "张强", "张三丰");
        //通过集合对象调用stream方法获取
        Stream<String> stream = list.stream();

        //通过Arrays数组工具类调用stream 方法
        String[] arr={"张三","李四","王五"};
        Stream<String> stream1 = Arrays.stream(arr);

        //通过Stream类中的方法获取Stream流对象

        Stream<String> stream2 = Stream.of("张三","李四","王五");
    }
}
